/**
  ******************************************************************************
  * @file    vk1629a_driver.h
  * @author  kevin_guo
  * @version V1.0.0
  * @date    07-01-2019
  * @brief   This file contains definitions for vk1629a_driver.
  ******************************************************************************
  * @attention
  ******************************************************************************  
  */
#ifndef __VK1629a_DRIVER_H__
#define __VK1629a_DRIVER_H__

#include "types.h"
#include "gpio.h"

/* Exported types ------------------------------------------------------------*/
/* Exported constants --------------------------------------------------------*/
/* Exported macro ------------------------------------------------------------*/
/* Exported define -----------------------------------------------------------*/
//以下管脚配置根据客户单片机做相应的修改 
// #define   MulitDisplayDriverEn
#ifdef   MulitDisplayDriverEn
#define  TM0_CS_PIN		      GPIO_P26
#define  TM1_CS_PIN		      GPIO_P27
#else
#define  TM_CS_PIN		      GPIO_P24
#endif
#define  TM_WR_PIN         	GPIO_P33
#define  TM_DATA_PIN        GPIO_P32
#define  TM_POWER_PIN       GPIO_P31
//--------------------------------------------------
//以下管脚输出定义根据客户单片机做相应的修改
#ifdef   MulitDisplayDriverEn
#define VK1629a0_STB_HIGH     HalGpioSet(TM0_CS_PIN,Bit_ENABLE)
#define VK1629a0_STB_LOW      HalGpioSet(TM0_CS_PIN,Bit_DISABLE) 

#define VK1629a1_STB_HIGH     HalGpioSet(TM1_CS_PIN,Bit_ENABLE)
#define VK1629a1_STB_LOW      HalGpioSet(TM1_CS_PIN,Bit_DISABLE) 
#else
#define VK1629a_STB_HIGH      HalGpioSet(TM_CS_PIN,Bit_ENABLE)
#define VK1629a_STB_LOW       HalGpioSet(TM_CS_PIN,Bit_DISABLE) 
#endif

#define VK1629a_SLK_HIGH      HalGpioSet(TM_WR_PIN,Bit_ENABLE)
#define VK1629a_SLK_LOW       HalGpioSet(TM_WR_PIN,Bit_DISABLE)

#define VK1629a_DAT_HIGH      HalGpioSet(TM_DATA_PIN,Bit_ENABLE)
#define VK1629a_DAT_LOW       HalGpioSet(TM_DATA_PIN,Bit_DISABLE)

 

#define   VK1629a_STARTADDR					  0XC0 
  

#define   VK1629a_WRDTA_AUTOADD1ADDR  0x40  
#define   VK1629a_WRDTA_FIXEDADDR   	0x44   
#define   VK1629a_CMD_READKEY     		0x42  

#define 	VK1629a_DISP_ON        		  0X88  //显示开
#define 	VK1629a_DISP_OFF		   			0x80  //显示关  
/*0x80, 0x81,  0x82,  0x83,  0x84,  0x85,  0x86,  0x87 分别对应
1/16,   2/16,  4/16,  10/16, 11/16, 12/16, 13/16, 14/16  */ 
#define 	VK1629a_PDUTY_1_16          0X80  //显示控制设置为脉冲宽度1/16  
#define 	VK1629a_PDUTY_2_16          0X81  //显示控制设置为脉冲宽度2/16  
#define 	VK1629a_PDUTY_4_16          0X82  //显示控制设置为脉冲宽度4/16  
#define 	VK1629a_PDUTY_10_16         0X83  //显示控制设置为脉冲宽度10/16  
#define 	VK1629a_PDUTY_11_16         0X84  //显示控制设置为脉冲宽度11/16  
#define 	VK1629a_PDUTY_12_16         0X85  //显示控制设置为脉冲宽度12/16  
#define 	VK1629a_PDUTY_13_16         0X86  //显示控制设置为脉冲宽度13/16  
#define 	VK1629a_PDUTY_14_16         0X87  //显示控制设置为脉冲宽度14/16  
//---------------------------------------------------------------
#define     Driver_DISPLAY_SIZE       16
//--------------------------------------------------
typedef uint8_t DisplayBufferType;
extern DisplayBufferType Driver_DisplayBuff[Driver_DISPLAY_SIZE];
/* Exported functions ------------------------------------------------------- */
void VK1629a_Init(void);  
void VK1629a_PowerDown(void);
#ifdef   MulitDisplayDriverEn
void VK1629a_Disp_AutoAdd1Addr(unsigned char addr,unsigned char* databuf, unsigned char num,unsigned char DriverIndex);
void VK1629a_Disp_FixedAddr(unsigned char addr, unsigned char data8,unsigned char DriverIndex);
#else
void VK1629a_Disp_AutoAdd1Addr(uint8_t addr,uint8_t* databuf, uint8_t num);
void VK1629a_Disp_FixedAddr(uint8_t addr, uint8_t data8);
#endif
#endif  /*__VK1629a_DRIVER_H__*/

/************************END OF FILE****/
